MBM Plugin


In this directory you can place your MBM plugin files.

When MBM starts it will create a file called PlugIn.log in this folder, in that file you will see if your plugin was accepted by MBM.

If you want to create a plugin then it has to have at least the type 1 functions inside, you can add other functions, if you do then increase the plugin type value you return to mbm

When a plug in is 1st installed you will need to restart MBM so it see's the plugin, MBM will not automaticly start the plugin the 1st time, you have to do this in the popup menu > plugin >

MBM will remember if a plug in was started or stopped when MBM closes, so next time you start MBM it will start all the plugins that where running when MBM last closed

Below are the function in delphi which are supported by MBM, check http://mbm.livewiredev.com/index3.html for more sample code as it comes available


type 1,2,3,4

mbm version 5.3.2.0

function PlugInType : Byte; stdcall;

description
This is the 1st call MBM will make, it will tell MBM what type of plugin to except, minimal value is 1

logged:
PlugInType : <value>, Failed

<value> when a plugin type is returned
Failed when the function is not found and thus the plugin will not be accepted

The table below shows which types need to support which function/procedures

Function/Procedure type 1 type 2 type 3 type 4
PlugInType
X
X
X
X
PlugInName
X
X
X
X
PlugInInit
X
X
X
X
PlugInStart
X
X
X
X
PlugInStop
X
X
X
X
CPlugInPulse
X
X
X
X
CPluginPause
X
X
X
X
CPlugInClose
X
X
X
X
CPlugInMenuName
X
X
CPluginOption
X
X
CPluginIO
X
X


type 1,2,3,4

mbm version 5.3.2.0

function PlugInName : PChar; stdcall;

description
Here MBM will get the name of your plugin, this name will be used as the 1st sub menu in the MBM popup menu

logged:
PlugInName : <value>

<value> when a plugin type is returned
Failed when the function is not found and thus the plugin will not be accepted


type 1,2,3,4

mbm version 5.3.2.0

function PlugInInit(P : PChar; H : Integer): Boolean; stdcall;

description
P will hold the MBM Path, in case you need
H will hold the MBM Handle, you will probably need this if you want to have forms in your DLL
If MBM does not get a True result the plugin will not be accepted

Here you can place all your code to initialise your plugin, this is not the same as starting your plugin.

logged:
PlugInInit : Found, Executed, Excecute Failed

Found when the function is found
Executed when the function is successfully executed
Execute Failed when the function is not successfully executed and thus the plugin will not be accepted


type 1,2,3,4

mbm version 5.3.2.0

function PlugInStart : Boolean; stdcall;

description
This function will not be called when you place the plugin for the 1st time, the user will have to start the plugin for the first time manually from the MBM popup menu.
If MBM does not get a True result after a user clicking on Start Plugin in the popup menu the plugin will not be listed as running, no pulses will be send and the plugin will not be autostarted on the next MBM start
If MBM does not get a True result on autostart the plugin will not be accepted by MBM, this will be displayed in the log as execute failed

This is the actual call to your plugin to start doing what is was made to do.

logged:
PlugInStart : Found, Executed, Excecute Failed, Not Executed

Found when the function is found
Executed when the function is successfully executed, thus is autostarted
Execute Failed when the function is not successfully executed and thus the plugin will not be accepted
Not Executed when the plugin is not autostarted, either because this is the 1st time you placed it or it was not running when you last closed MBM


type 1,2,3,4

mbm version 5.3.2.0

function PlugInStop : Boolean; stdcall;

description
This gets called by MBM when you close MBM and it gets called by the user when they select Stop PlugIn

logged:
PlugInStop : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 1,2,3,4

mbm version 5.3.2.0

procedure PlugInPulse; stdcall;

description
MBM calls to this procedure at the end of very interval, your plugin can use this to run on the same interval as MBM

logged:
PlugInPulse : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 1,2,3,4

mbm version 5.3.2.0

procedure PlugInPause(P : Boolean); stdcall;

description
P will be True when MBM is going into Pause mode, P will be false when MBM is comming out of Pause mode

logged:
PlugInPause: Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 1,2,3,4

mbm version 5.3.2.0

function PlugInClose : Boolean; stdcall;

description
This gets called by MBM when MBM closes, either by user command or windows

logged:
PlugInClose : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 2,4

mbm version 5.3.2.0

function PlugInMenuName : PChar; stdcall;

description
If your plugin requiers options or you want an about box then use this call, the value you send to MBM can just be one menu item or more, if you send more then seperate each menu item with a ; for example:

about

will make 1 submenu under your plugin name in the MBM popup menu with the text "about"

options; about

will make 2 submenu's under your plugin name in the MBM popup menu, one with the text "options" and the other with the text "about"

logged:
PlugMenuName : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 2,4

mbm version 5.3.2.0

procedure PlugInOption(O : byte); stdcall;

description
MBM will call this procedure when a user clicks on any of your options, O will hold the number of your options in the order you gave them using the PlugInMenuName starting with 1 for the 1st option

logged:
PlugInOption : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted


type 3,4

mbm version 5.3.3.0

procedure PluginIO(IOBR : TIOByteRead; IOBW : TIOByteWrite; IOWR : TIOWordRead; IOWW : TIOWordWrite; IODR : TIODWordRead; IODW : TIODWordWrite); stdcall;

description
This will give your plugin the option to read and write from IO ports using the MBMIO driver. The procedure will give you a pointer to each of the following procedures:

type
TIOByteRead = procedure(Port : Word; out Result: Byte); stdcall;
TIOByteWrite = procedure(Port : Word; Value : Byte); stdcall;
TIOWordRead = procedure(Port : Word; out Result: Word); stdcall;
TIOWordWrite = procedure(Port : Word; Value : Word); stdcall;
TIODWordRead = procedure(Port : Word; out Result: DWord); stdcall;
TIODWordWrite = procedure(Port : Word; Value : DWord); stdcall;

So you will need to make sure your plugin

logged:
PluginIO : Found, Failed

Found when the function was found
Failed when the function was not found and thus the plugin will not be accepted